<?php
namespace app\admin\controller;
use think\Controller;
use think\Request;
use think\Db;
class Base extends controller
{
    public function _initialize()
    {
        parent::_initialize();
        $this->assign('menu',$this->getMenu());
    }

    //获取导航菜单
    protected function getMenu(){
        $menu = Db::name('menu')->where('status',0)->select();
        $tree = list_to_tree($menu);
        return $tree;
    }

}